import 'package:flutter_test/flutter_test.dart';
import 'package:umeng_link_flutter/umeng_link_flutter.dart';
import 'package:umeng_link_flutter/umeng_link_flutter_platform_interface.dart';
import 'package:umeng_link_flutter/umeng_link_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUmengLinkFlutterPlatform
    with MockPlatformInterfaceMixin
    implements UmengLinkFlutterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final UmengLinkFlutterPlatform initialPlatform = UmengLinkFlutterPlatform.instance;

  test('$MethodChannelUmengLinkFlutter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelUmengLinkFlutter>());
  });

  test('getPlatformVersion', () async {
    UmengLinkFlutter umengLinkFlutterPlugin = UmengLinkFlutter();
    MockUmengLinkFlutterPlatform fakePlatform = MockUmengLinkFlutterPlatform();
    UmengLinkFlutterPlatform.instance = fakePlatform;

    expect(await umengLinkFlutterPlugin.getPlatformVersion(), '42');
  });
}
